package week06.person;

public class PersonServiceProxy implements PersonService {
    private  PersonService personService;

    public PersonServiceProxy(PersonService personService) {
        this.personService = personService;
    }

    public void save() {
        TransactionManger.begin();
        personService.save();
        TransactionManger.commit();
    }

    public void delete() {
        TransactionManger.begin();
        personService.delete();
        TransactionManger.commit();
    }

    public void update() {
        TransactionManger.begin();
        personService.update();
        TransactionManger.commit();
    }

    public void list() {
        personService.list();
    }
}
